There are application programs that require temporary changes to system-wide (or at least per-user) computer resources and settings, including components, devices and properties and that are shared among programs. For example, it is common for computer game programs to require a different video resolution from the resolution set for use by other programs, or for presentation applications to disable the screensaver and audio. Such resources and settings are usually configured by the user, or configured by the operating system during setup using default values, and apply to essentially everything that runs within the operating system.
In general, it is undesirable for an application program to override the user's configuration, because the resource states and settings affect everything else running on the system. However there are programs that need to make changes to resources and settings, as well as programs that make changes that the user does not desire. Heretofore, for proper behavior, any process that made a change to a resource state or setting had to be very careful to undo the change, before the process exited. For each application program, this is an on-off operation, and only works as well as the application's implementation of preserving, modifying and restoring any system-wide shared resources and system settings, as required. If the application's implementation does not properly behave or performs poorly, or if the application program crashes, some or all of the changes made are not properly restored, whereby the computer is left in an inconsistent state and/or a state not desirable to the user.